/**
 * @Author: xzm
 * @Date: 2019/9/10
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 通知通告维护列表分页查询
export const pageDealerInfoList = (params) => axios.get(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach`, { params });

//下发进销商
export const getDealerInfos = (params) => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/notification/getDealerInfos`, { params });

//  获取大区
export const getRegion = params => {return {
  "elapsedMilliseconds":0,
  "errMsg":null,
  "resultCode":200,
  "success":true,
  "data":[
    {
      "busiType": "10461001",
      "code": null,
      "companyId": "3",
      "createdAt": "1566462908000",
      "createdBy": "-1",
      "data": "G000202",
      "id": "14",
      "orgCode": "G000202",
      "orgId": "14",
      "orgName": "用友汽车公司1",
      "orgType": "15061003",
      "parent": "#",
      "parentOrgId": null,
      "remark": "",
      "sapOrgCode": "",
      "status": "10041001",
      "text": "用友汽车公司1",
      "updatedAt": "1566462908000",
      "updatedBy": "-1",
    },
    {
      "busiType": "10461001",
      "code": null,
      "companyId": "3",
      "createdAt": "1566462908000",
      "createdBy": "-1",
      "data": "G000202",
      "id": "15",
      "orgCode": "G000202",
      "orgId": "14",
      "orgName": "用友汽车公司2",
      "orgType": "15061003",
      "parent": "#",
      "parentOrgId": null,
      "remark": "",
      "sapOrgCode": "",
      "status": "10041001",
      "text": "用友汽车公司2",
      "updatedAt": "1566462908000",
      "updatedBy": "-1",
    },
  ]
}}

//  获取小区
export const getCommunity = params => {return {
  "elapsedMilliseconds":0,
  "errMsg":null,
  "resultCode":200,
  "success":true,
  "data":[
    {
      "busiType": "10461001",
      "code": null,
      "companyId": "3",
      "createdAt": "1566462908000",
      "createdBy": "-1",
      "data": "G000202",
      "id": "16",
      "orgCode": "G000202",
      "orgId": "14",
      "orgName": "用友汽车公司3",
      "orgType": "15061003",
      "parent": "15",
      "parentOrgId": null,
      "remark": "",
      "sapOrgCode": "",
      "status": "10041001",
      "text": "用友汽车公司3",
      "updatedAt": "1566462908000",
      "updatedBy": "-1",
    },
    {
      "busiType": "10461001",
      "code": null,
      "companyId": "3",
      "createdAt": "1566462908000",
      "createdBy": "-1",
      "data": "G000202",
      "id": "17",
      "orgCode": "G000202",
      "orgId": "14",
      "orgName": "用友汽车公司4",
      "orgType": "15061003",
      "parent": "14",
      "parentOrgId": null,
      "remark": "",
      "sapOrgCode": "",
      "status": "10041001",
      "text": "用友汽车公司4",
      "updatedAt": "1566462908000",
      "updatedBy": "-1",
    },
  ]
}}

//  获取经销商列表信息
export const getDealerList = params => {return {
  "resultCode": 200,
	"errMsg": null,
  "elapsedMilliseconds": 0,
  "success": true,
  "data":
  {
    "current": 1,
    "pages": 1,
    "size": 20,
    "total": 10,
    "records":[
      {
        "dealerId":1,
        "companyId":1,
        "groupCompanyId":1,
        "factoryCompanyId":1,
        "orgId":7,
        "orgType":"16081005",
        "appId":"cyx",
        "dealerCode":"G0002011",
        "dealerName":"用友汽车经销商",
        "dealerShortname":"用友汽车",
        "sourceChangedAt":null,
        "address":"定西路",
        "provinceId":1,
        "cityId":32,
        "countyId":33,
        "validStatus":10041001,
        "ownerParCode":"",
        "phone":"15136778909",
        "isAuz":0,
        "taxNo":"004324355",
        "faxNo":"852367",
        "linkMan":"小王",
        "zipCode":"23",
        "status":10041001,
        "agType":1,
        "saleArea":"",
        "priceGroup":null,
        "payCond":null,
        "stockSet":"",
        "email":"",
        "latitude":"36.047074539579678",
        "longitude":"103.86823327813235",
        "dotType":null,
        "distributorLevel":10001001,
        "authCustCode":"",
        "creditType":null,
        "businessStatus":1,
        "ascId":null,
        "ascCode":"",
      },
  {
        "dealerId":3,
        "companyId":2,
        "groupCompanyId":2,
        "factoryCompanyId":2,
        "orgId":3,
        "orgType":"15061009",
        "appId":"cyx",
        "dealerCode":"G000201",
        "dealerName":"用友汽车",
        "dealerShortname":"用友汽车",
        "sourceChangedAt":null,
        "address":"定西路",
        "provinceId":2,
        "cityId":49,
        "countyId":50,
        "validStatus":10041001,
        "ownerParCode":"",
        "phone":"15136778909",
        "isAuz":0,
        "taxNo":"004324355",
        "faxNo":"852367",
        "linkMan":"小王",
        "zipCode":"23",
        "status":10041001,
        "agType":1,
        "saleArea":"",
        "priceGroup":null,
        "payCond":null,
        "stockSet":"",
        "email":"",
        "latitude":"36.047074539579678",
        "longitude":"103.86823327813235",
        "dotType":null,
        "distributorLevel":10001002,
        "authCustCode":"",
        "creditType":null,
        "businessStatus":1,
        "ascId":null,
        "ascCode":"",
      },
    {
        "dealerId":4,
        "companyId":3,
        "groupCompanyId":1,
        "factoryCompanyId":1,
        "orgId":15,
        "orgType":"15061009",
        "appId":"cyx",
        "dealerCode":"G00020201",
        "dealerName":"用友汽车销售",
        "dealerShortname":"汽车销售",
        "sourceChangedAt":null,
        "address":"定西路",
        "provinceId":3,
        "cityId":66,
        "countyId":67,
        "validStatus":10041001,
        "ownerParCode":"",
        "phone":"15136778909",
        "isAuz":0,
        "taxNo":"004324355",
        "faxNo":"852367",
        "linkMan":"小王",
        "zipCode":"23",
        "status":10041001,
        "agType":1,
        "saleArea":"",
        "priceGroup":null,
        "payCond":null,
        "stockSet":"",
        "email":"",
        "latitude":"36.047074539579678",
        "longitude":"103.86823327813235",
        "dotType":null,
        "distributorLevel":10001001,
        "authCustCode":"",
        "creditType":null,
        "businessStatus":1,
        "ascId":null,
        "ascCode":"",
      },
    {
        "dealerId":5,
        "companyId":7,
        "groupCompanyId":1,
        "factoryCompanyId":4,
        "orgId":25,
        "orgType":"15061009",
        "appId":"ad",
        "dealerCode":"G00040101",
        "dealerName":"用友汽车奥迪销售",
        "dealerShortname":"奥迪汽车销售",
        "sourceChangedAt":null,
        "address":"定西路",
        "provinceId":4,
        "cityId":279,
        "countyId":280,
        "validStatus":10041001,
        "ownerParCode":"",
        "phone":"15136778909",
        "isAuz":0,
        "taxNo":"004324355",
        "faxNo":"852367",
        "linkMan":"小王",
        "zipCode":"23",
        "status":10041001,
        "agType":1,
        "saleArea":"",
        "priceGroup":null,
        "payCond":null,
        "stockSet":"",
        "email":"",
        "latitude":"36.047074539579678",
        "longitude":"103.86823327813235",
        "dotType":null,
        "distributorLevel":10001001,
        "authCustCode":"",
        "creditType":null,
        "businessStatus":1,
        "ascId":null,
        "ascCode":"",
      },
    {
        "dealerId":7,
        "companyId":9,
        "groupCompanyId":1,
        "factoryCompanyId":5,
        "orgId":32,
        "orgType":"15061009",
        "appId":"bq",
        "dealerCode":"G00040101",
        "dealerName":"用友汽车北汽销售",
        "dealerShortname":"北汽汽车销售",
        "sourceChangedAt":null,
        "address":"定西路",
        "provinceId":5,
        "cityId":426,
        "countyId":428,
        "validStatus":10041001,
        "ownerParCode":"",
        "phone":"15136778909",
        "isAuz":0,
        "taxNo":"004324355",
        "faxNo":"852367",
        "linkMan":"小王",
        "zipCode":"23",
        "status":10041001,
        "agType":1,
        "saleArea":"",
        "priceGroup":null,
        "payCond":null,
        "stockSet":"",
        "email":"",
        "latitude":"36.047074539579678",
        "longitude":"103.86823327813235",
        "dotType":null,
        "distributorLevel":10001001,
        "authCustCode":"",
        "creditType":null,
        "businessStatus":1,
        "ascId":null,
        "ascCode":"",
      }
    ]
  }
}};
